module.exports = app => {
    app.once('server', server => {
        // console.log(111);
        
      // websocket
    });
    app.on('error', (err, ctx) => {
        console.log(err);
      // report error
    });
    app.on('request', ctx => {
        // console.log(ctx);
      // log receive request
    });
    app.on('response', ctx => {
      // ctx.starttime is set by framework
      const used = Date.now() - ctx.starttime;
      // log total cost
    });
  };
  